package com.cf.faq.model;

import com.cf.code.core.CField;
import com.cf.code.core.CModel;
import com.cf.code.core.CPage;
import com.cf.code.core.FieldType;
import com.cf.crud.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * boot-message-Faq
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/7/12 下午 02:47
 */
@Entity
@Table(name = "faq")
@CModel(pages = {
        @CPage(title = "FAQ列表", path = "faq", templateName = "list.ftl", outPutName = "list.ftl"),
        @CPage(title = "FAQ", path = "faq", templateName = "add.ftl", outPutName = "add.ftl"),
        @CPage(title = "FAQ", path = "faq", templateName = "update.ftl", outPutName = "update.ftl")
})
public class Faq extends BaseEntity {


    @CField(lab = "标题")
    private String name;

    @CField(lab = "内容", type = FieldType.FULLTEXT)
    @Column(length = 2048)
    private String content;

    @Column(name = "addTime")
    @Temporal(TemporalType.TIMESTAMP)
    @CField(lab = "创建时间", type = FieldType.DATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date addTime = new Date();


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }
}
